package day09;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/1/8.
 */
public class Test08 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int sum1 = 0;
            int sum2 = 0;
            for (int i = 1; i <= n; i++) {
                if (i % 2 == 0) {
                    sum2 += factorial(i);
                } else {
                    sum1 += factorial(i);
                }
            }
            System.out.println(sum1 + " " + sum2);
        }
    }

    private static int factorial(int i) {
        if (i == 1 || i == 0) {
            return 1;
        }
        return i * factorial(i - 1);
    }
}
